
<include file="Common/header" />

<link rel="stylesheet" href="__PUBLIC__/css/orgnizerUserClass.css" type="text/css">
<link rel="stylesheet" href="__PUBLIC__/asset/vendor/bootstrap-table/bootstrap-table.min.css" type="text/css">

<div class="app">

    <!-- top header -->
    <include file="Common/header_nav" />
    <!-- /top header -->

    <section class="layout">
        <!-- sidebar menu -->
        <include file="Common/left_aside_admin" />
        <!-- /sidebar menu -->

        <!-- main content -->

        <section class="main-content">
            <header class="header navbar bg-default">
                <ul class="nav navbar-nav" id="ul-bar">

                    <li class="active">
                        <a href="#all-org" tabindex="-1" data-toggle="tab">组织机构总览</a>
                    </li>
                    <li style="display: none;">
                        <a href="#userlist" tabindex="-1" data-toggle="tab">查看组织用户列表</a>
                    </li>

                    <li style="display: none;">
                        <a href="#quizresult" tabindex="-1" data-toggle="tab">查看测评结果</a>
                    </li>
                </ul>
            </header>
            <!-- content wrapper -->
            <div class="content-wrap">
                <div id="myTabContent" class="tab-content">

                    <div class="tab-pane fade in active" id="all-org">
                        <section class="panel">
                            <header class="panel-heading">组织机构列表</header>
                            <div class="panel-body">
                                <div class="table-responsive">
                                    <table class="table table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>用户名</th>
                                            <th>邮箱</th>
                                            <th>组织名称</th>
                                            <th>组织简介</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>

                                        <tbody>


                                        <foreach name="rs" item="r">
                                            <tr>
                                                <td>{$r.oid}</td>
                                                <td>{$r.username}</td>
                                                <td>{$r.email}</td>
                                                <td>{$r.org_name}</td>
                                                <td>{$r.org_info}</td>
                                                <td><a class="btn-success btn-sm btn setoid">查看组织信息</a><a class="btn-danger btn-sm btn">删除组织</a></td>
                                            </tr>
                                        </foreach>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </section>
                    </div>
                    <div class="tab-pane fade in" id="quizresult">


                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                查看测试状态
                            </div>

                            <div class="panel-body">

                                <div class="row">
                                    <div class="col-md-10">
                                        <section class="panel">
                                            <div class="form-group">
                                                <label >点击选择组织测试的标题</label>
                                                <select class="form-control" id="quiz_title_select">
                                                    <option>1</option>
                                                    <option>2</option>
                                                    <option>3</option>
                                                    <option>4</option>
                                                    <option>5</option>
                                                </select>
                                            </div>

                                            <div class="panel-heading">测试进度</div>
                                            <div class="panel-body no-padding">
                                                <table class="table table-striped no-margin">
                                                    <thead>
                                                    <tr>
                                                        <th class="col-md-2 pd-l-lg">
                                                            <span class="pd-l-sm"></span>uid</th>
                                                        <th class="col-md-2">用户名</th>
                                                        <th class="col-md-2">邮箱</th>
                                                        <th class="col-md-2">问卷名</th>
                                                        <th class="col-md-2">开始时间</th>
                                                        <th class="col-md-2">进度</th>
                                                        <th class="col-md-2">操作</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody id="quizstatus_tbody">

                                                    </tbody>
                                                </table>
                                            </div>
                                            <div class="panel-footer ">
                                                <a class="btn btn-success" id="show-group-report">显示已完成用户集体报告</a>
                                                <a class="btn btn-success" id="download-group-pdf">下载集体报告</a>
                                            </div>
                                        </section>

                                    </div>
                                    <div class="col-md-6">
                                        <div class="panel">
                                            <div class="panel heading">
                                                预警设置
                                            </div>

                                            <div class="panel-body">
                                                <label>16pf预警维度设置</label>

                                                <table class="table table-bordered table-striped responsive">
                                                    <thead>
                                                    <tr>
                                                        <th>指标</th>
                                                        <th>操作</th>
                                                        <th>值</th>

                                                    </tr>
                                                    </thead>

                                                    <tbody id="warn-set-list">

                                                    </tbody>
                                                </table>

                                            </div>
                                            <div class="panel-footer">
                                                <a class="btn btn-success" id="commit-warnvalue">保存预警设置</a>
                                            </div>

                                        </div>


                                    </div>
                                </div>



                            </div>
                        </div>





                    </div>
                    <div class="tab-pane fade in  " id="userlist">
                        <div class="panel panel-primary">
                            <div class="panel-heading">
                                用户组织
                            </div>

                            <div class="panel-body">
                                <div class="row">

                                    <div class="col-md-3">
                                        <div class="row">
                                            <div class="col-xs-12">
                                                <form role="form" class="form-horizontal parsley-form" data-parsley-validate="" novalidate="">

                                                    <div class="form-group">
                                                        <label class="col-sm-4 control-label">团体名称</label>
                                                        <div class="col-sm-8">
                                                            <input type="text" class="form-control" placeholder="输入团队名称" id="org-name" value="" disabled>
                                                        </div>
                                                    </div>
                                                </form>
                                            </div>

                                            <div class="col-lg-12">

                                                <div class="cf nestable-lists">
                                                    <div class="dd" id="nestable">

                                                        <div class="edit-area">
                                                            <input type="text" class="form-control addclass"  placeholder="输入级别名称（如班级，部门名）" id="class-inputval"   /><a class="btn btn-primary btn-sm btn-parsley" id="submit-class" style="margin-top: 10px;">添加一级子级</a>
                                                        </div>
                                                    </div>


                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="col-md-9">
                                        <div class="row">
                                            <div class="col-lg-12">

                                                <a class="btn btn-success" id="save-classinfo">保存组织信息</a>
                                                <a class="btn btn-success" id="edit-classinfo">编辑组织信息</a>

                                                <pre id="nestable-output" style="display: none;"></pre>

                                                </a>


                                                <div class="col-xs-12" >
                                                    <section class="panel">
                                                        <div class="panel-heading">用户列表</div>
                                                        <div class="panel-body no-padding">

                                                            <div id="toolbar"></div>

                                                            <table class="table table-striped no-margin table-bordered" id="user-list-table">

                                                            </table>
                                                        </div>
                                                        <div class="panel-footer">
                                                            <div><a class="btn btn-success" id="add-user-btn">添加用户</a>
                                                                <a class="btn btn-success" id="xls-upload-btn">导入用户</a></div>
                                                            <input type="file" id="xls-upload" style="display: none;">
                                                        </div>
                                                    </section>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                </div>
            </div>
            <!-- /content wrapper -->
        </section>
        <!-- /main content -->
    </section>

</div>


<!-- 添加用户对话框 -->
<div class="modal fade" id="add-user" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false">
    <div class="modal-dialog" >
        <div class="modal-content">
            <div class="modal-header">
               添加用户<a id="add-user-classinfo"></a>
            </div>
            <div class="modal-body" >
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-body">
                            <form role="form">
                                <div class="form-group">
                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <td>用户名</td>
                                            <td>密码</td>
                                            <td>邮箱（可选）</td>
                                            <td></td>
                                        </tr>
                                        </thead>
                                        <tbody id="add-user-tbody">
                                        <tr>
                                            <td><input class="form-control" type="text" id="add-username" /></td>
                                            <td><input class="form-control" type="text" id="add-userpasswd"/></td>
                                            <td><input class="form-control" type="email" id="add-useremail"/></td>
                                            <td><a class="btn btn-success" id="add-user-newrow">添加一行</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
            <div class="modal-footer" ><a class="btn btn-success" id="add-user-save">保存</a></div>
        </div>

        </div>
    </div>


<!-- 编辑用户信息对话框 -->
<div class="modal fade" id="edit-user" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-keyboard="false">
    <div class="modal-dialog" >
        <div class="modal-content">
            <div class="modal-header">
                编辑用户<a id="edit-uid"></a>
            </div>
            <div class="modal-body" >
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel-body">
                            <form role="form">
                                <div class="form-group">
                                    <label for="edit-username">修改用户名</label>
                                    <input type="text" class="form-control" placeholder="修改用户名" id="edit-username">
                                    <label for="edit-useremail">修改邮箱</label>
                                    <input type="email" class="form-control" placeholder="修改用户名" id="edit-useremail">
                                    <label for="edit-userpassword">重置密码</label>
                                    <input type="email" class="form-control" placeholder="修改用户名" id="edit-userpassword">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>
            <div class="modal-footer" ><a class="btn btn-success" id="edit-user-save">保存</a></div>
        </div>

    </div>
</div>


<include file="Common/footer" />
<script src="__PUBLIC__/asset/vendor/jquery.nestableNoDrag.js"></script>
<script src="__PUBLIC__/asset/vendor/jquery.sortable.js"></script>
<script src="__PUBLIC__/asset/vendor/bootstrap-table/bootstrap-table.min.js"></script>

<script src="__PUBLIC__/js/orgnizerUserClass.js"></script>
<script src="__PUBLIC__/js/orgnizerQuizStatus.js"></script>

<script src="__PUBLIC__/js/adminIndex.js"></script>
<script>

    $(document).ready(function(){
        $("#show-group-report").click(function(){
            window.location = "/Home/Orgnizer/show_16pf_groupreport/quiztitle/"+$("#quiz_title_select").val();
        });
        $("#download-group-pdf").click(function(){

            window.localtion = "/Home/Orgnizer/downloadSingleUserGroupReportPdf/quiztitle/"+$("#quiz_title_select").val();
        });
    });



</script>